package cn.getech.data.development.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 表字段信息
 * </p>
 *
 * @author zenith
 * @since 2019-07-08
 */
@Data
@TableName("bdp_table_field")
@ApiModel(description = "字段信息")
public class TableFieldInfo implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * 编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 表编号
     */
    @TableField("table_id")
    private Integer tableId;
    @TableField(value = "tenant_id")
    private Integer tenantId;
    /**
     * 字段名称
     */
    @TableField("field_name")
    private String fieldName;

    /**
     * 老字段的字段名称
     */
    @TableField(exist=false)
    private String olderFieldName;

    /**
     * 字段类别
     */
    @TableField("field_type")
    private String fieldType;

    /**
     * 老的字段类别
     */
    @TableField(exist = false)
    private String olderFieldType;

    /**
     * 字段的别名
     */
    @TableField("field_alias")
    private String fieldAlias;

    /**
     * 是否是分区字段
     */
    @TableField("is_partition")
    private Integer isPartition;

    @TableField("field_order")
    private Integer fieldOrder;

    /**
     * 字段等级id
     */
    @TableField("colcum_level_id")
    private Integer colcumLevelId;

    /**
     * 加密方式id
     */
    @TableField("ency_style_id")
    private Integer encyStyleId;

    @TableField(exist = false)
    private String dbName;
    @TableField(exist = false)
    private String tableName;

    /**
     * 表密级信息
     */
    @TableField(exist=false)
    private String levelName;

    @TableField("security_data_level")
    private String securityDataLevel;


    @TableField("create_per")
    private Integer createPer;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

    // 是否主键    0 否  1 是
    @TableField("primary_key")
    private Integer primaryKey;
    /**
     * 血缘
     */
    @ApiModelProperty(value = "血缘")
    @TableField(exist=false)
    private List<TableRelationshipEntity> relationshipes;
}
